package person.bluext.singlegateway.gateway;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import person.bluext.singlegateway.frame.BaseController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Description : Request dispatch controller
 *
 * @author bluext
 */
@RestController
public class DispatchController extends BaseController {

    @Autowired
    private TheFuncStore theFuncStore;// function store

    @PostMapping("/gateway")
    public void gateway(@RequestBody String jsonReqStr, HttpServletRequest request, HttpServletResponse response) {
        this.sendJsonResponse(response, this.processRequest(jsonReqStr, theFuncStore, request, response));
    }
}
